package entities.axiom;

import java.util.HashSet;
import java.util.Set;

import option.KBVocabulary;

import entities.KBEntity;
import entities.role.Role;

/**
 * This class is for role hierarchy, i.e., R \sqsubseteq S, where R/S are (inverse) roles.
 * @author j55wu
 *
 */
public class RoleInclusionAxiom extends RoleAxiom{

	private final Role subr, superr;
	
	public RoleInclusionAxiom(Role rl, Role rr) {
//		super(rl, rr);
		this.subr = rl;
		this.superr = rr;
	}

	public final Role getSubRole(){
		return this.subr;
	}
	
	public final Role getSuperRole(){
		return this.superr;
	}

	@Override
	public RoleInclusionAxiom getPrimeCopy() {
		return new RoleInclusionAxiom(this.subr.getPrimeCopy(), this.superr.getPrimeCopy());
	}
	
	@Override
	public String toString(){
		return "("+KBVocabulary.ROLEAXIOM+" "+subr.toSerializedString()+" "
				+superr.toSerializedString()+")";
	}

	@Override 
	public Set<KBEntity> extractSig(){
		Set<KBEntity> sig = new HashSet<KBEntity>();
		sig.addAll(subr.extractSig());
		sig.addAll(superr.extractSig());
		return sig;
	}
	

}
